//
//  BaiheAdSDKNativeAd.h
//  BaiheAdSDK
//
//  Created by 陈坤 on 2025/9/28.
//

#import <Foundation/Foundation.h>
#import "BaiheAdSDKNativeAdViewDelegate.h"

NS_ASSUME_NONNULL_BEGIN

@protocol BaiheAdSDKNativeAdDelegate;

@interface BaiheAdSDKNativeAd : NSObject

/**
 代理回调
*/
@property (nonatomic, weak) id<BaiheAdSDKNativeAdDelegate> delegate;


/*
 设置根控制器，用于落地页弹出
 */
@property (nonatomic, weak) UIViewController *controller;

/**
 广告位id
*/
@property (nonatomic, copy) NSString *posId;

/**
 是否静音，默认静音
 */
@property (nonatomic, assign) BOOL isMuted;

/**
 信息流自动播放，默认WiFi自动播放 开启后WiFi/4G自动播放
 */
@property(nonatomic ,assign) BOOL autoPlay;

/**
 加载广告

 @param count 拉取几条广告,建议区间 1~5, 超过可能无法拉取到
 */
- (void)loadNativeAd:(int)count;

/**
 是否正在加载广告
 */
- (BOOL)isLoadingAd;


- (void)setAdScenes:(NSDictionary *)scenes;

/**
 获取广告的竞价价格，单位分，为0则表示未成功获取到广告，或者不支持竞价，开启该功能需要联系媒介商务
 */
- (NSInteger)getBidPrice;
/**
 发送竞价成功上报
 @param price 赢价价格，单位分
 */
- (void)sendWinNotice:(NSInteger)price;

/**
 发送竞价失败上报
 @param price 赢价价格，单位分
 */
- (void)sendLossNotice:(NSInteger)price;

@end

@protocol BaiheAdSDKNativeAdDelegate <NSObject>

@optional

/**
 信息流原生广告请求成功

 @param nativeAd 广告实例
 @param adViewArray 广告模板集合
 */
- (void)Baihe_nativeAdSucessToLoad:(BaiheAdSDKNativeAd *)nativeAd
                      adViewArray:(NSArray<__kindof UIView<BaiheAdSDKNativeAdViewDelegate> *> *)adViewArray;

/**
 信息流广告请求失败

 @param nativeAd 广告实例
 @param error 请求错误描述
 */
- (void)Baihe_nativeAdFailToLoad:(BaiheAdSDKNativeAd *)nativeAd
                     error:(NSError *)error;

/**
 信息流广告被点击

 @param nativeAd 广告模板
 */
- (void)Baihe_nativeAdClicked:(BaiheAdSDKNativeAd *)nativeAd
                      adView:(__kindof UIView<BaiheAdSDKNativeAdViewDelegate> *)adView;

/**
 信息流广告被关闭
 
 @param nativeAd 广告模板
 */
- (void)Baihe_nativeAdClose:(BaiheAdSDKNativeAd *)nativeAd
                    adView:(__kindof UIView<BaiheAdSDKNativeAdViewDelegate> *)adView;

/**
 信息流广告被展示
 
 @param nativeAd 广告实例
 */
- (void)Baihe_nativeAdExposure:(BaiheAdSDKNativeAd *)nativeAd
                       adView:(__kindof UIView<BaiheAdSDKNativeAdViewDelegate> *)adView;

/**
 信息流广告展示上报
 
 @param nativeAd 广告实例
 */
- (void)Baihe_nativeAdExposureReport:(BaiheAdSDKNativeAd *)nativeAd
                       adView:(__kindof UIView<BaiheAdSDKNativeAdViewDelegate> *)adView;

/**
 信息流广告点击上报

 @param nativeAd 广告模板
 */
- (void)Baihe_nativeAdClickedReport:(BaiheAdSDKNativeAd *)nativeAd
                           adView:(__kindof UIView<BaiheAdSDKNativeAdViewDelegate> *)adView;

/**
 信息流广告落地页被关闭
 
 @param nativeAd 广告实例
 */
- (void)Baihe_nativeAdCloseLandingPage:(BaiheAdSDKNativeAd *)nativeAd
                       adView:(__kindof UIView<BaiheAdSDKNativeAdViewDelegate> *)adView;

@end


NS_ASSUME_NONNULL_END
